/**
 * 日志工具
 * @author whyccup
 */
const winston = require('winston')
const logger = winston.createLogger({
    transports: [
        new winston.transports.Console(),
        new winston.transports.File({
            filename: '../logs/nxtz-log-error.log',
            level: 'error'
        })
    ],
    exceptionHandlers: [
        new winston.transports.Console(),
        new winston.transports.File({
            filename: '../logs/nxtz-log-break.log',
        })
    ],
})

exports.error = (path, msg, status) => {
    logger.error({
        path: path,
        message: msg,
        status: status,
        timestamp: new Date().getTime()
    })
}